import 'package:appflutterhomeschool/res/styles.dart';
import 'package:appflutterhomeschool/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

///用户： ninetailedfox
///时间： 2020/6/26
///邮箱： 1037438704@qq.com
///功能： 学生页面的组件

class RowWidgetLab extends StatelessWidget {
  final String textContent;
  final String imageUrl;
  final double rightPadding;
  final CrossAxisAlignment crossAxisAlignment;
  final MainAxisAlignment mainAxisAlignment;
  final bool visible;
  final GestureTapCallback onTap;

  RowWidgetLab({this.imageUrl,this.onTap,this.visible, this.textContent,this.rightPadding,this.crossAxisAlignment,this.mainAxisAlignment});

  @override
  Widget build(BuildContext context) {
    return Visibility(
      visible: visible??true,
      child: GestureDetector(
        child: Padding(
          padding: EdgeInsets.only(right: ScreenUtil().setWidth(rightPadding??100)),
          child: Row(
            crossAxisAlignment: crossAxisAlignment??CrossAxisAlignment.center,
            mainAxisAlignment:mainAxisAlignment?? MainAxisAlignment.center,
            children: <Widget>[
              Visibility(
                visible: imageUrl != null,
                child: Container(child: Image.asset(Utils.getImgPath(imageUrl)),margin: EdgeInsets.only(right: 3),),
              ),
              Text(textContent ?? "", style: TextStyles.textContent31),
            ],
          ),
        ),
        onTap: onTap,
      ),
    );
  }
}
